Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The application context of the android app.

Link copied to clipboard

This object is used to invoke asset commands of Engine. It should be accessed after calling start and before calling stop otherwise it will throw an exception.

Link copied to clipboard

This object is used to invoke block commands of Engine. It should be accessed after calling start and before calling stop otherwise it will throw an exception.

Link copied to clipboard

Returns the base uri of the default asset sources that was previously passed to addDefaultAssetSources.

Link copied to clipboard
val dispatcher: MainCoroutineDispatcher

Coroutine dispatcher of the Engine thread. It is always main thread coroutine dispatcher for public usage.

Link copied to clipboard

This object is used to invoke editor commands of Engine. It should be accessed after calling start and before calling stop otherwise it will throw an exception.

Link copied to clipboard

This object is used to invoke event commands of Engine. It should be accessed after calling start and before calling stop otherwise it will throw an exception.

Link copied to clipboard
Link copied to clipboard

Set this flag as true if you want the Engine to become idle if it has no pending work. This is useful for UI testing, as Espresso expects UI thread to become idle before making any assertions (without this flag your UI tests will always be stuck as main thread is never idle due to the never ending Engine update calls). Default value is false. Note that the flag is experimental and might be changed/removed.

Link copied to clipboard

Hides the floating text-selection ActionMode window.

Link copied to clipboard

Looper of the Engine thread. It is always main thread looper for public usage.

Link copied to clipboard

This object is used to invoke scene commands of Engine. It should be accessed after calling start and before calling stop otherwise it will throw an exception.

Link copied to clipboard

This object is used to invoke variable commands of Engine. It should be accessed after calling start and before calling stop otherwise it will throw an exception.

Functions

Link copied to clipboard
suspend fun Engine.addDefaultAssetSources(baseUri: Uri = Engine.assetBaseUri, exclude: Set<DefaultAssetSource> = emptySet()): Job

Convenience function that registers a set of asset sources containing our example assets. Note: See DefaultAssetSource enum for available values. Note: By default, these assets are parsed from the IMG.LY CDN at https://cdn.img.ly/packages/imgly/cesdk-android/<version>/assets/<id>/content.json.

Link copied to clipboard
suspend fun Engine.addDemoAssetSources(exclude: Set<DemoAssetSource> = emptySet(), withUploadAssetSources: Boolean = false, baseUri: Uri = Engine.assetBaseUri)

Convenience function that registers a set of demo asset sources containing our example assets. Note: See DemoAssetSource enum for available values. Note: By default, these assets are parsed from the IMG.LY CDN at https://cdn.img.ly/packages/imgly/cesdk-android/<version>/assets/<id>/content.json.

Link copied to clipboard

Registers a new listener that is invoked every time bound SurfaceView's or TextureView's Surface is created/recreated. This, for instance, can be used to update the android.graphics.SurfaceTexture instance in BlockApi.setNativePixelBuffer.

Link copied to clipboard
suspend fun awaitStart()
Link copied to clipboard
fun bindOffscreen(@IntRange(from = 1) width: Int, @IntRange(from = 1) height: Int)

Binds offscreen context to the Engine. This should be used when the Engine is used without UI. Note that only one engine instance can be bound at a time. Calling bindOffscreen unbinds other engine instances.

Link copied to clipboard

Binds surfaceHolder to the Engine. All rendered frames will be drawn into the surface of surfaceHolder. Note that only one engine instance can be bound at a time. Calling bindSurfaceHolder unbinds other engine instances.

Link copied to clipboard

Binds surfaceView to the Engine. All rendered frames will be drawn into the surfaceView. Note that only one engine instance can be bound at a time. Calling bindSurfaceView unbinds other engine instances.

Link copied to clipboard

Binds textureView to the Engine. All rendered frames will be drawn into the textureView. Note that only one engine instance can be bound at a time. Calling bindTextureView unbinds other engine instances.

Link copied to clipboard

Returns all the keypath-value setting pairs of the Engine. Useful when copying settings between Engine instances (see importSettings).

Link copied to clipboard

Sets all the keypath-value setting pairs to the Engine. Useful when copying settings between Engine instances (see exportSettings).

Link copied to clipboard

Tells whether the engine is bound. The engine is being in bound state in between one of bound and unbind function invocations.

Link copied to clipboard

Tells whether the engine is currently running.

Link copied to clipboard

Pauses the current engine. All the resources of the engine will remain in the memory, however the engine will not consume any processing power. Call unpause to revert the effect. This method is useful when you want to save processing power resources when the engine is inactive in your current UI. It is also useful, when you have multiple engine instances: we highly recommend that you always keep 1 active engine at a time. When switching the current active engine, call pause on the remaining engine instances.

Link copied to clipboard
suspend fun Engine.populateAssetSource(id: String, jsonUri: Uri, replaceBaseUri: Uri? = null)

Creates and adds a new local asset source with id. A describing content json file is fetched from jsonUri and containing assets are added to the local asset source. Note: Check "https://cdn.img.ly/packages/imgly/cesdk-android/1.81.0/assets/ly.img.sticker/content.json" for the structure of the json file.

Link copied to clipboard

Unregisters listener that was previously registered via addSurfaceCreatedListener.

Link copied to clipboard
open override fun saveState(): Bundle
Link copied to clipboard
suspend fun start(license: String? = null, userId: String? = null, savedStateRegistryOwner: SavedStateRegistryOwner? = null, buildHost: String = ""): Boolean

Starts the Engine. After this invocation all the APIs can be used. The opposite of this method is stop. Note that other than userId we also use the android.provider.Settings.Secure.ANDROID_ID for better data accuracy. You should include it in the Data safety form of your application when uploading it to the Play Store.

Link copied to clipboard

Stops the engine. All the native resources will be released and scene will not be available anymore. All subsequent calls to any of the APIs will result to thrown exceptions. In order to use Engine again, start should be invoked. This method also invokes unbind if necessary. Note that after calling stop other Engine instances that have the same id will crash upon any usage.

Link copied to clipboard

Releases the surface buffers and clears the reference of SurfaceView if bindTextureView was called or of TextureView if bindTextureView was called.

Link copied to clipboard

Unpauses the current engine that was paused before via pause.